package com.we823.project.repository.dao.repo;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import com.we823.project.model.repo.MaterialStockModel;

@Repository("materialStockRepository")
public interface MaterialStockRepository extends JpaRepository<MaterialStockModel, Integer> {

	MaterialStockModel findByMaterialCodeAndYearAndMonthAndDay(String materialCode, int year, int month, int day);

	List<MaterialStockModel> findByMaterialCodeAndYear(String materialCode, int year);

	List<MaterialStockModel> findByMaterialCodeAndYear(String materialCode, int year, Sort sort);

	List<MaterialStockModel> findByMaterialCode(String materialCode, Sort sort);

	List<MaterialStockModel> findByYearAndMonthAndMaterialCodeIn(int year, int month, List<String> materialCodeList, Sort sort);

	Page<MaterialStockModel> findByMaterialCode(String code, Pageable pageable);

	Page<MaterialStockModel> findByMaterialCodeStartingWith(String code,
			Pageable pageable);

	Page<MaterialStockModel> findByMaterialCodeIn(
			List<String> materialCodeList, Pageable pageable);

	List<MaterialStockModel> findByYearAndMaterialCodeIn(int year,
			List<String> materialCodeList);

	List<MaterialStockModel> findByYearAndMonthAndMaterialCodeIn(int year,
			int month, List<String> materialCodeList);

	Page<MaterialStockModel> findByYearAndMonthAndDayAndMaterialCodeIn(
			int year, int month, int day, List<String> materialCodeList,
			Pageable pageable);

	List<MaterialStockModel> findByYearAndMonthAndDayAndMaterialCodeIn(
			int year, int month, int day, List<String> materialCodeList);

	List<MaterialStockModel> findByMaterialCodeIn(List<String> materialCodeList);

}
